//***********************************************************************
//	File:		Credits.cpp
//	Author:		
//	Course:		SGP 1405
//	Purpose:	
//***********************************************************************
//***********************************************************************
//	Purposfully left blank for all comments regarding this file 
//	
//	
//	
//***********************************************************************

#include "Credits.h"
#include "../source/BitmapFont.h"
#include "../source/Game.h"
#include "../GameStates/Play.h"

#include "../GameStates/MainMenu.h"

#include "../SGD Wrappers/SGD_AudioManager.h"
#include "../SGD Wrappers/SGD_GraphicsManager.h"
#include "../SGD Wrappers/SGD_InputManager.h"

Credits* Credits::GetInstance()
{
	static Credits s_pInstance; 
	return &s_pInstance; 
}


void Credits::Enter(void)
{
	// Set a credits background here

	int width = (int)Game::GetInstance()->GetScreenWidth();

	m_ptPosition.x = (float)width / 2;
	m_ptPosition.y = 500.0f;

	finalY = -1500;
}
	

void Credits::Exit(void)
{

}

bool Credits::Input(void)
{
	if (SGD::InputManager::GetInstance()->IsKeyPressed(SGD::Key::Escape) == true)
	{
		Game::GetInstance()->ChangeState(MainMenu::GetInstance());
	}
	return true; 
}
void Credits::Update(float dt)
{
	m_ptPosition.y -= 50 * dt;
	if (m_ptPosition.y <= finalY)
	{
		Game::GetInstance()->ChangeState(MainMenu::GetInstance()); 
	}
}

void Credits::Render(void)
{
	// List the strings and colors here
	BitmapFont* pFont = Game::GetInstance()->GetFont(); 
	SGD::GraphicsManager* pGraphics = SGD::GraphicsManager::GetInstance();

	pFont->Draw("Executive Producer", (int)m_ptPosition.x - 150, (int)m_ptPosition.y, 1.0f, SGD::Color{ 255, 200, 0 });
	pFont->Draw("John OLeske", (int)m_ptPosition.x - 100, (int)m_ptPosition.y + 50, 1.0f, SGD::Color{ 255, 200, 0 }); 

	pFont->Draw("Associate Producer", (int)m_ptPosition.x - 150, (int)m_ptPosition.y + 150, 1.0f, SGD::Color{ 255, 200, 0 });
	pFont->Draw("Sean Hathaway", (int)m_ptPosition.x - 125, (int)m_ptPosition.y + 200, 1.0f, SGD::Color{ 255, 200, 0 });

	pFont->Draw("Programmers", (int)m_ptPosition.x - 100, (int)m_ptPosition.y + 300, 1.0f, SGD::Color{ 255, 200, 0 });
	pFont->Draw("Ryan Simmons", (int)m_ptPosition.x - 125, (int)m_ptPosition.y + 350, 1.0f, SGD::Color{ 255, 200, 0 });
	pFont->Draw("Chris Folk", (int)m_ptPosition.x - 110, (int)m_ptPosition.y + 400, 1.0f, SGD::Color{ 255, 200, 0 }); 




}